00001 00007 class LinearConstraint: public osgUtil::DelaunayConstraint { 00008 00009 public: 00010 LinearConstraint() : osgUtil::DelaunayConstraint(), txxrepAlong(10), txyrepAcross(10), width(2) { } 00011 00015 virtual void setTexrep(const float w,const float h) { txyrepAcross=h;txxrepAlong=w; } 00016 00020 virtual void setVertices( osg::Vec3Array *lp, const float width); 00021 00025 virtual osg::Geometry *makeGeometry(const osg::Vec3Array *points) ; 00026 00030 osg::Vec3Array* getNormals(const osg::Vec3Array *points); 00031 00035 virtual osg::DrawArrays* makeRoad( ) const; 00036 virtual osg::Vec3Array *getRoadVertices() const; 00037 virtual osg::Vec2Array *getRoadTexcoords(const osg::Vec3Array *points) ; 00038 00039 virtual osg::Vec3Array *getRoadNormals(const osg::Vec3Array *points) const; 00040 00044 void setTexture(const char *tx) { texture=tx;} 00045 00046 protected: 00047 //public: 00048 osg::ref_ptr<osg::Vec2Array> _tcoords; 00049 osg::ref_ptr<osg::Vec3Array> _edgecoords; 00050 float txxrepAlong, txyrepAcross; 00051 std::string texture; 00055 float width; 00059 osg::ref_ptr<osg::Vec3Array> _midline; 00060 };
1.4.6-NO